//
//  TestEffectView.swift
//  SwiftUIAnimation
//
//  Created by 李煜 on 2024/8/20.
//

import SwiftUI

struct TestEffectView: View {
  @State private var isloading = false
  var body: some View {
    Circle()
      .trim(from: 0.0, to: 0.76)
      .stroke(Color.blue, lineWidth: 12)
      .frame(width: 200)

      .rotationEffect(.degrees(isloading ? 360 : 0))
      .animation(.default.repeatForever(autoreverses: false), value: isloading)
      .onAppear {
        isloading = true
      }
  }
}

#Preview {
  TestEffectView()
}
